
							*=================================================*
							* Where is the party - EJPG 					  *
							* Siegel and Turnbull-Dugarteand Olinger 		  * 
							* JUNE 2021										  *					
							*=================================================*

	
use "/Users/stuartturnbulldugarte/Box/Where'sTheParty/STU/RR_DATA/EJPG_repfile.dta"


//TABLE 1\\
melogit opposeban i.gender i.agecat i.Education Married ib(0).religious c.year i.ceec || country_id:,
outreg2 using regtable.doc, dec(2) replace 
melogit opposeban i.gender i.agecat i.Education Married ib(0).religious i.family1  c.year i.ceec || country_id:,
outreg2 using regtable.doc, dec(2) append
melogit opposeban i.gender i.agecat i.Education Married ib(0).religious state_market liberty_authority c.year i.ceec || country_id:,
outreg2 using regtable.doc, dec(2) append
melogit opposeban i.gender i.agecat i.Education Married ib(0).religious i.family1 state_market liberty_authority c.year i.ceec || country_id:,
outreg2 using regtable.doc, dec(2) append


//Figure 3\\
melogit opposeban i.gender i.agecat i.Education Married ib(0).religious state_market liberty_authority c.year i.ceec || country_id:,
margins, dydx(*) post
estimates store m5a

melogit opposeban i.gender i.agecat i.Education Married ib(0).religious i.family1 state_market liberty_authority c.year i.ceec || country_id:,
margins, dydx(*) post
estimates store m5

coefplot m5a || m5,  xline(0, lpattern(dash)) ci(95 90) msymbol(circle) ///
msize(small) ciopts(recast(. rcap) ) ///
 groups(?.gender = "{bf: Gender}" ?.agecat = "{bf:Age}"  ///
?.Education = "{bf: Education}" ?.family1 = "{bf:Party Family}" Married = "{bf:Civil status}" state_market = "{bf:Ideology}" year = "{bf:Time trends}" ?.religious = "{bf:Religious}" ?.ceec = "{bf: Post-Communist}" ) rescale(100) mlabel format(%9.2g) mlabposition(5) mlabgap(*.2) mlabs(vsmall) 
graph save AMEplot.gph, replace



//Figure 4\\
melogit opposeban i.gender i.agecat i.Education Married i.family1##ib(0).religious i.ceec state_market liberty_authority c.year i.ceec || country_id:,
margins religious, at(family1=(0 1 2 3 4 5 6 7 8))
marginsplot, horizontal recast(scatter) legend(position(6) row(1)) scheme(538w)
graph save interact_partyrelig_full.gph



//Figure 2/
twoway (scatter liberty_authority state_market if family1==0) (scatter liberty_authority state_market if family1==1) (scatter liberty_authority state_market if family1==2) (scatter liberty_authority state_market if family1==3) (scatter liberty_authority state_market if family1==4) (scatter liberty_authority state_market if family1==5) (scatter liberty_authority state_market if family1==6) (scatter liberty_authority state_market if family1==7) (scatter liberty_authority state_market if family1==8), scheme(538w) legend(position(12) row(3))
